﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using InHD.commands;

namespace InHD.viewmodels
{
	public class WorkspaceViewModel : ViewModelBase
	{
		private string _header;
		public string Header
		{
			get { return _header; }
			set
			{
				_header = value;
				OnPropertyChanged("Header");
			}
		}

        private RelayCommand _closeCommand;
		public ICommand CloseCommand
		{
            get { return _closeCommand ?? (_closeCommand = new RelayCommand((param) => this.OnRequestClose())); }
		}

        #region RequestClose [event]

        /// <summary>
        /// Raised when this workspace should be removed from the UI.
        /// </summary>
        public event EventHandler RequestClose;

        public void OnRequestClose()
        {
            EventHandler handler = this.RequestClose;
            if (handler != null)
                handler(this, EventArgs.Empty);
        }

        #endregion // RequestClose [event]
	}
}
